package com.linln.modules.roadrescue.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;


/**
 * @author : pengliang
 * @version V1.0
 * @Project: timo
 * @Package com.linln.modules.roadrescue.domain
 * @Descriptio /**
 * @Project: timo
 * @Package com.linln.modules.roadrescue.domain
 * @Description: TODO
 * @date Date : 2021年01月07日 10:24
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tbl_road_rescue")
public class RoadRescue {
    /**
     * id
     */
    @TableId(value = "rr_id", type = IdType.UUID)
    private String rrId;

    /**
     * 客户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 客户姓名
     */
    @TableField(value = "customer_name")
    private String customerName;

    /**
     * 客户电话
     */
    @TableField(value = "customer_phone")
    private String customerPhone;

    /**
     * 故障描述
     */
    @TableField(value = "fault_describe")
    private String faultDescribe;

    /**
     * 故障地点
     */
    @TableField(value = "fault_locale")
    private String faultLocale;

    /**
     * 车牌
     */
    @TableField(value = "plate")
    private String plate;

    /**
     * 0等待处理 1正在处理  2处理完成
     */
    @TableField(value = "`status`")
    private Integer status;

    /**
     * 报警时间
     */
    @TableField(value = "alarm_date")
    private String alarmDate;

//    /**
//     * 处理时间
//     */
//    @TableField(value = "handle_date")
//    private String handleDate;

    /**
     * 扩展字段
     */
    @TableField(value = "props")
    @JsonIgnore()
    private String props;

    @JsonGetter
    public Map<String,Object> getProps(){
        return JSON.parseObject(props, Map.class);
    }
    @TableField(exist = false)
    private String textNew;
    @TableField(exist = false)
    private String timeNew;
}
